﻿@using System.Globalization
@using CkSoftware.GroupMe.Sdk.TestWeb.Helpers
@model CkSoftware.GroupMe.Sdk.TestWeb.Models.AddedMembersModel

@{
    ViewBag.Title = "AddMember Result";
}

<div class="page-header">
    <h1>Results of the add member operation</h1>
</div>

<p>Operation Status: <strong>@Model.Data.Status</strong></p>

<h2>Added members</h2>
@using(var memberTable = Html.Bootstrap().Begin(new Table().Striped()))
{
    using (memberTable.BeginHeader())
    {
        <tr>
            <th>Avatar</th>
            <th>Id</th>
            <th>UserId</th>
            <th>Nickname</th>
            <th>App installed</th>
        </tr>
    }
    using (var memberBody = memberTable.BeginBody())
    {
        foreach (var member in Model.Data.AddedMembers)
        {
            using (var memberRow = memberBody.BeginRow())
            {
                @memberRow.Cell(Html.AvatarImageForGroupMePicture(member.AvatarImage, member.Nickname))
                @memberRow.Cell(member.Id)
                @memberRow.Cell(member.UserId)
                @memberRow.Cell(member.Nickname)
                @memberRow.Cell(member.AppInstalled.ToString(CultureInfo.CurrentCulture))
            }
        }
    }
}

@Html.ActionLink("Back to group details", "GroupDetail", new { groupId = Model.GroupId })

